home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmPlayground BackColor = &H00FFFFFF& BorderStyle = 1 'Fixed Single Caption = "ITGraph Property Playground" ClientHeight = 6168 ClientLeft = 156 ClientTop = 504 ClientWidth = 9420 Height = 6540 Icon = ITGDEMO1.FRX:0000 Left = 108 LinkTopic = "frmPlayground" ScaleHeight = 6168 ScaleWidth = 9420 Top = 180 Width = 9516 Begin PictureBox txtTransferTarget Height = 1752 Left = 6960 ScaleHeight = 1728 ScaleWidth = 1788 TabIndex = 72 Tag = "Click here to return to main screen." Top = 2880 Visible = 0 'False Width = 1812 End Begin ListBox lstConnectionInfo BackColor = &H00FFFF00& FontBold = 0 'False FontItalic = 0 'False FontName = "Times New Roman" FontSize = 9 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 1248 Left = 6240 Sorted = -1 'True TabIndex = 85 Tag = "Select a node and scroll graph to that node." Top = 3960 Visible = 0 'False Width = 2772 End Begin CheckBox chkRedraw Caption = "Redraw" Height = 192 Left = 4020 TabIndex = 80 Top = 3720 Value = 1 'Checked Width = 972 End Begin ListBox lstSelectNode BackColor = &H00FFFF00& FontBold = 0 'False FontItalic = 0 'False FontName = "Times New Roman" FontSize = 9 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 1248 Left = 6240 Sorted = -1 'True TabIndex = 64 Tag = "Select a node and scroll graph to that node." Top = 3600 Visible = 0 'False Width = 2772 End Begin PictureBox pctSpecialMenu BackColor = &H0080FFFF& Height = 3972 Left = 6096 ScaleHeight = 3948 ScaleWidth = 2988 TabIndex = 56 Top = 1920 Visible = 0 'False Width = 3012 Begin CommandButton cmdPrintReport Caption = "&R" Height = 312 Left = 120 TabIndex = 86 Top = 1020 Width = 372 End Begin CommandButton cmdConnectionInfo Caption = "&I" Height = 312 Left = 120 TabIndex = 83 Top = 2100 Width = 372 End Begin CommandButton cmdFitToWindow Caption = "&F" Height = 312 Left = 120 TabIndex = 78 Top = 300 Width = 372 End Begin CommandButton cmdCancel Height = 312 Left = 120 TabIndex = 75 Top = 3540 Width = 372 End Begin CommandButton cmdCommand Caption = "&T" Height = 312 Left = 120 TabIndex = 70 Top = 3180 Width = 372 End Begin CommandButton cmdSaveAs Caption = "&V" Height = 312 Left = 120 TabIndex = 67 Top = 2820 Width = 372 End Begin CommandButton cmdClear Caption = "&C" Height = 312 Left = 120 TabIndex = 65 Top = 2460 Width = 372 End Begin CommandButton cmdGenRandom Caption = "&G" Height = 312 Left = 120 TabIndex = 59 Top = 1380 Width = 372 End Begin CommandButton cmdSelectNode Caption = "&S" Height = 312 Left = 120 TabIndex = 58 Top = 1740 Width = 372 End Begin CommandButton cmdPrintGraph Caption = "&P" Height = 312 Left = 120 TabIndex = 57 Top = 660 Width = 372 End Begin Label Label7 BackColor = &H0080FFFF& Caption = "Print a Report" Height = 252 Left = 540 TabIndex = 87 Top = 1080 Width = 1572 End Begin Label Label6 BackColor = &H0080FFFF& Caption = "Info on a Graph Connection" Height = 252 Left = 540 TabIndex = 84 Top = 2160 Width = 2472 End Begin Label Label4 BackColor = &H0080FFFF& Caption = "Fit Graph to Window." Height = 252 Left = 540 TabIndex = 77 Top = 360 Width = 1872 End Begin Label Label21 BackColor = &H0080FFFF& Caption = "Cancel" Height = 252 Left = 540 TabIndex = 76 Top = 3600 Width = 792 End Begin Label Label19 BackColor = &H0080FFFF& Caption = "Transfer Graph to a Control" Height = 252 Left = 540 TabIndex = 71 Top = 3240 Width = 2412 End Begin Label Label18 BackColor = &H0080FFFF& BorderStyle = 1 'Fixed Single Caption = "SPECIAL ITGRAPH FUNCTIONS" FontBold = -1 'True FontItalic = 0 'False FontName = "Arial" FontSize = 9 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 252 Left = 0 TabIndex = 69 Top = 0 Width = 3012 End Begin Label Label17 BackColor = &H0080FFFF& Caption = "Save the Current Graph" Height = 252 Left = 540 TabIndex = 68 Top = 2880 Width = 2052 End Begin Label Label16 BackColor = &H0080FFFF& Caption = "Clear the Graph" Height = 252 Left = 540 TabIndex = 66 Top = 2520 Width = 1692 End Begin Label Label15 BackColor = &H0080FFFF& Caption = "Select a Node in the Graph" Height = 252 Left = 540 TabIndex = 63 Top = 1800 Width = 2472 End Begin Label Label14 BackColor = &H0080FFFF& Caption = "Generate a Random Graph" Height = 252 Left = 540 TabIndex = 62 Top = 1440 Width = 2412 End Begin Label Label13 BackColor = &H0080FFFF& Caption = "Print the Graph" Height = 252 Left = 540 TabIndex = 61 Top = 720 Width = 1572 End End Begin PictureBox pctMain Height = 6192 Left = 0 ScaleHeight = 6168 ScaleWidth = 9408 TabIndex = 11 Top = 0 Width = 9432 Begin ITGraph ITGraph1 ArrangeMode = 2 'FlowChart AutoArrange = 1 'AutoArrange AutoMouseEvents = ITGDEMO1.FRX:0302 BackColor = &H00C0C0C0& DragItems = 0 'False DrawArrows = -1 'True DrawBackLinks = 2 'ITG_DashedBackLinks DrawColored = -1 'True DrawConnLabels = -1 'True DrawDir = 3 'Top To Bottom DrawHandles = -1 'True DrawItemLabels = -1 'True DrawScale = 100 FillColor = &H0000FFFF& FontBold = -1 'True FontItalic = 0 'False FontName = "Times New Roman" FontSize = 7.8 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Gap = 10 GraphicAllowImport= 3 'Delete Design Time Graphics Graphics = ITGDEMO1.FRX:0332 Height = 5292 Left = 60 LineWidth = 0 PrintHeader = "" PrintRectHeight = -1 PrintRectLeft = -1 PrintRectTop = -1 PrintRectWidth = -1 Redraw = -1 'True RubberBand = 3 'RB For Both SelectedIndex = -1 SelectRectEnabled= -1 'True SelectRectHeight= 0 SelectRectLeft = 0 SelectRectTop = 0 SelectRectWidth = 0 StoreGraphics = 2 'Save Referenced Graphics TabIndex = 81 Top = 180 Width = 3792 XSpace = 20 XSpan = 120 YSpace = 20 YSpan = 50 End Begin PictureBox pctZoomNode AutoSize = -1 'True BorderStyle = 0 'None DragIcon = ITGDEMO1.FRX:0334 Height = 384 Left = 4560 Picture = ITGDEMO1.FRX:0636 ScaleHeight = 384 ScaleWidth = 384 TabIndex = 79 Top = 5580 Width = 384 End Begin CommandButton cmdSpecial Caption = "&Special" Height = 432 Left = 6120 TabIndex = 60 Top = 5520 Width = 1032 End Begin CommonDialog CMDialog1 CancelError = -1 'True Filter = "ITGraph Files (*.ITG)|*.ITG" FilterIndex = 1 HelpCommand = 1 HelpFile = "ITGraph.HLP" Left = 60 Top = 5760 End Begin CommandButton cmdLoadFrom Caption = "&LoadFrom" Height = 432 Left = 7200 TabIndex = 14 Top = 5520 Width = 1032 End Begin CommandButton cmdQuit Caption = "&Quit" Height = 432 Left = 8280 TabIndex = 13 Top = 5520 Width = 1032 End Begin CommandButton cmdAddItem Caption = "&AddItem" Height = 432 Left = 5040 TabIndex = 12 Top = 5520 Width = 1032 End Begin Frame frameProperties Caption = "ITGraph Global Properties" Height = 5412 Left = 3900 TabIndex = 15 Top = 60 Width = 5412 Begin PictureBox pctBackColor BackColor = &H00C0C0C0& Height = 192 Left = 120 ScaleHeight = 168 ScaleWidth = 168 TabIndex = 54 Top = 300 Width = 192 End Begin PictureBox pctFillColor BackColor = &H0000FFFF& Height = 192 Left = 120 ScaleHeight = 168 ScaleWidth = 168 TabIndex = 53 Top = 540 Width = 192 End Begin PictureBox pctForeColor BackColor = &H00000000& Height = 192 Left = 120 ScaleHeight = 168 ScaleWidth = 168 TabIndex = 52 Top = 780 Width = 192 End Begin CheckBox chkEnabled Caption = "Enabled" Height = 192 Left = 120 TabIndex = 51 Top = 3180 Value = 1 'Checked Width = 972 End Begin CheckBox chkVisible Caption = "Visible" Height = 192 Left = 120 TabIndex = 50 Top = 3420 Value = 1 'Checked Width = 972 End Begin TextBox edtSampleText Alignment = 2 'Center BackColor = &H0000FFFF& FontBold = -1 'True FontItalic = 0 'False FontName = "Times New Roman" FontSize = 7.8 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 372 Left = 120 MultiLine = -1 'True TabIndex = 49 Text = "Sample Text" Top = 1020 Width = 1512 End Begin HScrollBar hscDrawScale Height = 195 Left = 3300 Max = 9999 TabIndex = 48 Top = 600 Value = 100 Width = 1455 End Begin TextBox edtDrawScale Height = 285 Left = 4800 MaxLength = 4 TabIndex = 47 Text = "100" Top = 540 Width = 555 End Begin TextBox edtXSpan Height = 285 Left = 4800 MaxLength = 3 TabIndex = 46 Text = "120" Top = 840 Width = 555 End Begin HScrollBar hscXSpan Height = 195 Left = 3300 Max = 250 TabIndex = 45 Top = 900 Value = 120 Width = 1455 End Begin TextBox edtYSpan Height = 285 Left = 4800 MaxLength = 3 TabIndex = 44 Text = "50" Top = 1140 Width = 555 End Begin HScrollBar hscYSpan Height = 195 Left = 3300 Max = 250 TabIndex = 43 Top = 1200 Value = 50 Width = 1455 End Begin HScrollBar hscXSpace Height = 195 Left = 3300 Max = 250 TabIndex = 42 Top = 1500 Value = 20 Width = 1455 End Begin TextBox edtXSpace Height = 285 Left = 4800 MaxLength = 3 TabIndex = 41 Text = "20" Top = 1440 Width = 555 End Begin HScrollBar hscYSpace Height = 195 Left = 3300 Max = 250 TabIndex = 40 Top = 1800 Value = 20 Width = 1455 End Begin TextBox edtYSpace Height = 285 Left = 4800 MaxLength = 3 TabIndex = 39 Text = "20" Top = 1740 Width = 555 End Begin HScrollBar hscGap Height = 195 Left = 3300 Max = 250 TabIndex = 38 Top = 2100 Value = 10 Width = 1455 End Begin TextBox edtGap Height = 285 Left = 4800 MaxLength = 3 TabIndex = 37 Text = "10" Top = 2040 Width = 555 End Begin TextBox edtLineWidth Height = 285 Left = 4800 MaxLength = 3 TabIndex = 36 Text = "0" Top = 2340 Width = 555 End Begin HScrollBar hscLineWidth Height = 195 Left = 3300 Max = 100 TabIndex = 35 Top = 2400 Width = 1455 End Begin Frame Frame3 Caption = "ArrangeMode" Height = 1452 Left = 2760 TabIndex = 30 Top = 3840 Width = 2532 Begin OptionButton optArrangeMode Caption = "ITG_ModeTree" Height = 252 Index = 3 Left = 120 TabIndex = 34 TabStop = 0 'False Top = 1140 Width = 1992 End Begin OptionButton optArrangeMode Caption = "ITG_ModeFlowChart" Height = 252 Index = 2 Left = 120 TabIndex = 33 Top = 840 Value = -1 'True Width = 1992 End Begin OptionButton optArrangeMode Caption = "ITG_ModeCompact" Height = 252 Index = 1 Left = 120 TabIndex = 32 TabStop = 0 'False Top = 540 Width = 1992 End Begin OptionButton optArrangeMode Caption = "ITG_ModeHierarchy" Height = 252 Index = 0 Left = 120 TabIndex = 31 TabStop = 0 'False Top = 240 Width = 1992 End End Begin Frame frameAutoArrange Caption = "AutoArrange" Height = 1452 Left = 120 TabIndex = 26 Top = 3840 Width = 2532 Begin OptionButton optAutoArrange Caption = "ITG_AutoArrange" Height = 252 Left = 120 TabIndex = 29 Top = 540 Value = -1 'True Width = 1812 End Begin OptionButton optManualArrange Caption = "ITG_ManualArrange" Height = 252 Left = 120 TabIndex = 28 TabStop = 0 'False Top = 240 Width = 2052 End Begin CommandButton cmdArrangeNow Caption = "ITG_ArrangeNow" Height = 432 Left = 360 TabIndex = 27 Top = 900 Width = 1812 End End Begin CheckBox chkDrawConnLabels Caption = "DrawConnLabels" Height = 192 Left = 120 TabIndex = 25 Top = 2460 Value = 1 'Checked Width = 1752 End Begin CheckBox chkDrawItemLabels Caption = "DrawItemLabels" Height = 192 Left = 120 TabIndex = 24 Top = 2940 Value = 1 'Checked Width = 1692 End Begin CheckBox chkDrawBackLinks Caption = "DrawBackLinks" Height = 192 Left = 120 TabIndex = 23 Top = 1740 Value = 1 'Checked Width = 1632 End Begin CheckBox chkDrawHandles Caption = "DrawHandles" Height = 192 Left = 120 TabIndex = 22 Top = 2700 Value = 1 'Checked Width = 1452 End Begin ComboBox cmbDrawDir Height = 288 Left = 3300 Style = 2 'Dropdown List TabIndex = 21 Top = 240 Width = 1992 End Begin ComboBox cmbRubberBand Height = 300 Left = 3300 Style = 2 'Dropdown List TabIndex = 20 Top = 2700 Width = 2055 End Begin CheckBox chkDrawArrows Caption = "DrawArrows" Height = 192 Left = 120 TabIndex = 19 Top = 1500 Value = 1 'Checked Width = 1452 End Begin CheckBox chkZoomOnSelectRect Caption = "Zoom On SelectRect" Height = 252 Left = 3300 TabIndex = 18 Top = 3000 Value = 1 'Checked Width = 2052 End Begin CheckBox chkDrawColored Caption = "DrawColored" Height = 192 Left = 120 TabIndex = 17 Top = 2220 Value = 1 'Checked Width = 1392 End Begin CheckBox chkDashed Caption = "Dashed" Height = 192 Left = 360 TabIndex = 16 Top = 1980 Value = 1 'Checked Width = 972 End Begin Label Label1 Caption = "BackColor" Height = 192 Left = 360 TabIndex = 0 Top = 300 Width = 972 End Begin Label Label2 Caption = "FillColor" Height = 192 Left = 360 TabIndex = 1 Top = 540 Width = 972 End Begin Label Label3 Caption = "ForeColor" Height = 192 Left = 360 TabIndex = 2 Top = 780 Width = 972 End Begin Label lblDrawScale Alignment = 1 'Right Justify Caption = "DrawScale:" Height = 192 Left = 2220 TabIndex = 3 Top = 600 Width = 1032 End Begin Label lblXSpan Alignment = 1 'Right Justify Caption = "XSpan:" Height = 192 Left = 2580 TabIndex = 4 Top = 900 Width = 672 End Begin Label lblYSpan Alignment = 1 'Right Justify Caption = "YSpan:" Height = 192 Left = 2580 TabIndex = 5 Top = 1200 Width = 672 End Begin Label lblXSpace Alignment = 1 'Right Justify Caption = "XSpace:" Height = 192 Left = 2460 TabIndex = 6 Top = 1500 Width = 792 End Begin Label lblYSpace Alignment = 1 'Right Justify Caption = "YSpace:" Height = 192 Left = 2520 TabIndex = 7 Top = 1800 Width = 732 End Begin Label lblGap Alignment = 1 'Right Justify Caption = "Gap:" Height = 192 Left = 2760 TabIndex = 8 Top = 2100 Width = 492 End Begin Label lblLineWidth Alignment = 1 'Right Justify Caption = "LineWidth:" Height = 192 Left = 2280 TabIndex = 9 Top = 2400 Width = 972 End Begin Label lblDrawDir Caption = "DrawDir:" Height = 192 Left = 2520 TabIndex = 10 Top = 300 Width = 732 End Begin Label Label12 Alignment = 1 'Right Justify Caption = "RubberBand:" Height = 192 Left = 2100 TabIndex = 55 Top = 2760 Width = 1152 End End Begin Label lblUnderCursor BorderStyle = 1 'Fixed Single Caption = "<None>" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Serif" FontSize = 7.8 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 492 Left = 1320 TabIndex = 74 Top = 5580 Width = 3132 End Begin Label Label20 Caption = "Under cursor:" Height = 252 Left = 60 TabIndex = 73 Top = 5580 Width = 1212 End End Begin Label Label5 BackColor = &H0080FFFF& Caption = "Select a Node in the Graph" Height = 252 Left = 420 TabIndex = 82 Top = 60 Width = 2472 End Declare Function GetDC% Lib "User" (ByVal hWnd%) Declare Sub ReleaseDC Lib "User" (ByVal hWnd%, ByVal hDC%) Sub chkDashed_Click () If chkDashed.Value Then ITGraph1.DrawBackLinks = ITG_DashedBackLinks Else ITGraph1.DrawBackLinks = ITG_SolidBackLinks End If End Sub Sub chkDrawArrows_Click () ITGraph1.DrawArrows = chkDrawArrows.Value End Sub Sub chkDrawBackLinks_Click () If chkDrawBackLinks.Value Then chkDashed.Enabled = True If chkDashed.Value Then ITGraph1.DrawBackLinks = ITG_DashedBackLinks Else ITGraph1.DrawBackLinks = ITG_SolidBackLinks End If Else chkDashed.Enabled = False ITGraph1.DrawBackLinks = ITG_NoBackLinks End If End Sub Sub chkDrawColored_Click () ITGraph1.DrawColored = chkDrawColored.Value End Sub Sub chkDrawConnLabels_Click () ITGraph1.DrawConnLabels = chkDrawConnLabels.Value End Sub Sub chkDrawHandles_Click () ITGraph1.DrawHandles = chkDrawHandles.Value End Sub Sub chkDrawItemLabels_Click () ITGraph1.DrawItemLabels = chkDrawItemLabels.Value End Sub Sub chkEnabled_Click () ITGraph1.Enabled = chkEnabled.Value End Sub Sub chkRedraw_Click () 'Setting Redraw to 1 may cause the graph to be redrawn 'This may take a while, so we show the hourglass Screen.MousePointer = 11 ITGraph1.Redraw = chkRedraw.Value Screen.MousePointer = 0 End Sub Sub chkVisible_Click () ITGraph1.Visible = chkVisible.Value End Sub Sub cmbDrawDir_Click () ITGraph1.DrawDir = cmbDrawDir.ListIndex End Sub Sub cmbRubberBand_Click () ITGraph1.RubberBand = cmbRubberBand.ListIndex End Sub Sub cmdAddItem_Click () frmPlayground.Enabled = False frmItemProperties!txtListIndex.Caption = "" frmItemProperties.Show End Sub Sub cmdArrangeNow_Click () ITGraph1.AutoArrange = ITG_ArrangeNow optManualArrange.Value = 1 End Sub Sub cmdCancel_Click () pctSpecialMenu.Visible = False pctSpecialMenu.Enabled = True pctMain.Enabled = True End Sub Sub cmdClear_Click () ITGraph1.Clear pctSpecialMenu.Visible = False pctMain.Enabled = True End Sub Sub cmdCommand_Click () txtTransferTarget.Visible = True 'Setting SelectRectWidth and SelectRectHeight to 0 'selects the entire graph. ITGraph1.SelectRectWidth = 0 ITGraph1.SelectRectHeight = 0 'Setting PrintRectWidth and PrintRectHeight to 0 'fills the entire control window. ITGraph1.PrintRectWidth = 0 ITGraph1.PrintRectHeight = 0 ITGraph1.PrintToWnd = txtTransferTarget.hWnd txtTransferTarget.SetFocus End Sub Sub cmdConnectionInfo_Click () Dim i% 'To get all the connections, we will iterate through the 'nodes of the graph, retrieving all targets for each node. 'The ITG_QueryTargets query gets all connections from the 'node specified by QueryItem to another node. 'We store the ConnectionId in the ItemData of the list so 'we can later look up the connection. lstConnectionInfo.Clear For i = 0 To ITGraph1.ListCount - 1 ITGraph1.QueryItem = i ITGraph1.QueryState = ITG_QueryGetTargets While ITGraph1.QueryState If ITGraph1.ConnectionLabel = "" Then lstConnectionInfo.AddItem "[" & Format$(ITGraph1.ConnectionId) & "]" Else lstConnectionInfo.AddItem ITGraph1.ConnectionLabel End If lstConnectionInfo.ItemData(lstConnectionInfo.NewIndex) = ITGraph1.ConnectionId ITGraph1.QueryState = ITG_QueryIterate Wend Next i lstConnectionInfo.Visible = True lstConnectionInfo.SetFocus End Sub Sub cmdFitToWindow_Click () 'Setting DrawScale to 0 scales the graph to the control window. ITGraph1.DrawScale = 0 pctSpecialMenu.Visible = False pctMain.Enabled = True End Sub Sub cmdGenRandom_Click () 'Create a random graph with five nodes and five connections Dim oldRedraw%, n%, c%, ix1%, ix2% 'Save the Redraw state, and set to false. This prevents 'the graph from updating until all changes are done. oldRedraw% = ITGraph1.Redraw ITGraph1.Redraw = False Screen.MousePointer = 11 ITGraph1.Clear For n = 1 To 5 ITGraph1.AddItem "Node " & Format$(ITGraph1.ListCount + 1) Next n n = ITGraph1.ListCount For c = 1 To 5 ix1 = Int(ITGraph1.ListCount * Rnd(1)) ix2 = Int(ITGraph1.ListCount * Rnd(1)) ITGraph1.ConnectTo(ix1) = ix2 ITGraph1.ConnectionLabel = "(" & Format$(ix1) & "," & Format$(ix2) & ")" ITGraph1.ConnectFromHandle = Int(4 * Rnd(1)) + 1 ITGraph1.ConnectToHandle = Int(4 * Rnd(1)) + 1 Next c ITGraph1.Redraw = oldRedraw Screen.MousePointer = 0 pctSpecialMenu.Visible = False pctMain.Enabled = True End Sub Sub cmdLoadFrom_Click () 'Load an ITGraph graph file, and set the Property Playground 'controls to correspond to the loaded graph. On Error GoTo cmdLoadFrom_Error CMDialog1.Action = 1 ITGraph1.LoadFrom = CMDialog1.Filename pctBackColor.BackColor = ITGraph1.BackColor pctFillColor.BackColor = ITGraph1.FillColor pctForeColor.BackColor = ITGraph1.ForeColor edtSampleText.BackColor = ITGraph1.FillColor edtSampleText.ForeColor = ITGraph1.ForeColor edtSampleText.FontName = ITGraph1.FontName edtSampleText.FontSize = ITGraph1.FontSize edtSampleText.FontBold = ITGraph1.FontBold edtSampleText.FontItalic = ITGraph1.FontItalic edtSampleText.FontStrikethru = ITGraph1.FontStrikethru edtSampleText.FontUnderline = ITGraph1.FontUnderline chkDrawColored.Value = Abs(ITGraph1.DrawColored) chkDrawConnLabels.Value = Abs(ITGraph1.DrawConnLabels) chkDrawItemLabels.Value = Abs(ITGraph1.DrawItemLabels) If ITGraph1.DrawBackLinks = ITG_NoBackLinks Then chkDrawBackLinks.Value = False chkDashed.Value = False chkDashed.Enabled = False Else chkDrawBackLinks.Value = 1 chkDashed.Enabled = True If ITGraph1.DrawBackLinks = ITG_DashedBackLinks Then chkDashed.Value = 1 Else chkDashed.Value = 0 End If End If chkDrawHandles.Value = Abs(ITGraph1.DrawHandles) chkDrawArrows.Value = Abs(ITGraph1.DrawArrows) cmbDrawDir.ListIndex = ITGraph1.DrawDir hscDrawScale.Value = ITGraph1.DrawScale edtDrawScale.Text = ITGraph1.DrawScale hscXSpan.Value = ITGraph1.XSpan edtXSpan.Text = ITGraph1.XSpan hscYSpan.Value = ITGraph1.YSpan edtYSpan.Text = ITGraph1.YSpan hscXSpace.Value = ITGraph1.XSpace edtXSpace.Text = ITGraph1.XSpace hscYSpace.Value = ITGraph1.YSpace edtYSpace.Text = ITGraph1.YSpace hscGap.Value = ITGraph1.Gap edtGap.Text = ITGraph1.Gap hscLineWidth.Value = ITGraph1.LineWidth edtLineWidth.Text = ITGraph1.LineWidth cmbRubberBand.ListIndex = ITGraph1.RubberBand optArrangeMode(ITGraph1.ArrangeMode) = True If ITGraph1.AutoArrange = ITG_AutoArrange Then optAutoArrange.Value = True Else optManualArrange.Value = True End If cmdLoadFrom_Error: Exit Sub End Sub Sub cmdPrintGraph_Click () 'Print the graph in its current scale. 'The PrintHeader below will print "ITGraph Property Playground" 'in the top center (position &2), today's date in the top right '(position &3), and "Page p of n", where p is the page number 'and n is the number of pages, in the bottom center (position &5). ITGraph1.PrintHeader = "&2ITGraph Property Playground&3" & Date & "&5Page &p of &n" On Error GoTo cmdPrintGraph_Error CMDialog1.Flags = &H100& + &H8& + &H4& CMDialog1.Action = 5 ITGraph1.PrintGraph = CMDialog1.hDC pctSpecialMenu.Visible = False pctMain.Enabled = True Exit Sub cmdPrintGraph_Error: Exit Sub End Sub Sub cmdPrintReport_Click () Dim iLeft%, iTop%, iWidth%, iHeight% Dim TwipsPerInch%, InsetTwips% Dim oldDrawColored% TwipsPerInch = 1440 InsetTwips = TwipsPerInch / 8 'Inset Graph 1/8" from border Screen.MousePointer = 11 Printer.Print Printer.Print "ITGraph Property Playground" Printer.Print "Current Graph and Associated Statistics" Printer.Print iLeft = Printer.CurrentX iTop = Printer.CurrentY iWidth = 4 * TwipsPerInch iHeight = 2 * TwipsPerInch Printer.Line (iLeft, iTop)-Step(iWidth, iHeight), , B oldDrawColored = ITGraph1.DrawColored ITGraph1.DrawColored = False ITGraph1.PrintToDC = 0 'Select Entire Graph ITGraph1.PrintRectLeft = (iLeft + InsetTwips) / Printer.TwipsPerPixelX ITGraph1.PrintRectTop = (iTop + InsetTwips) / Printer.TwipsPerPixelY ITGraph1.PrintRectWidth = (iWidth - 2 * InsetTwips) / Printer.TwipsPerPixelX ITGraph1.PrintRectHeight = (iHeight - 2 * InsetTwips) / Printer.TwipsPerPixelY ITGraph1.PrintToDC = Printer.hDC ITGraph1.DrawColored = oldDrawColored Printer.CurrentX = iLeft Printer.CurrentY = iTop + iHeight Printer.Print Printer.Print "The Graph Contains " & CStr(ITGraph1.ListCount) & " Nodes" For i = 0 To ITGraph1.ListCount - 1 Printer.Print " Node " & CStr(i) & ": " & ITGraph1.List(i) Next i Printer.EndDoc pctSpecialMenu.Visible = False pctMain.Enabled = True Screen.MousePointer = 0 End Sub Sub cmdQuit_Click () End End Sub Sub cmdSaveAs_Click () On Error GoTo cmdSaveAs_Error CMDialog1.Action = 2 ITGraph1.SaveAs = CMDialog1.Filename pctSpecialMenu.Visible = False pctMain.Enabled = True cmdSaveAs_Error: pctSpecialMenu.Visible = False pctMain.Enabled = True Exit Sub End Sub Sub cmdSelectNode_Click () 'Fill the lstSelectNode list with the node names. lstSelectNode.Clear For i = 0 To ITGraph1.ListCount - 1 lstSelectNode.AddItem ITGraph1.List(i) lstSelectNode.ItemData(lstSelectNode.NewIndex) = i Next i lstSelectNode.Visible = True lstSelectNode.SetFocus End Sub Sub cmdSpecial_Click () pctMain.Enabled = False pctSpecialMenu.Visible = True End Sub Sub edtDrawScale_LostFocus () If Val(edtDrawScale.Text) > hscDrawScale.Max Then hscDrawScale.Value = hscDrawScale.Max Else hscDrawScale.Value = Val(edtDrawScale.Text) End If End Sub Sub edtGap_Change () hscGap.Value = Val(edtGap.Text) ITGraph1.Gap = Val(edtGap.Text) End Sub Sub edtLineWidth_Change () hscLineWidth.Value = Val(edtLineWidth.Text) ITGraph1.LineWidth = Val(edtLineWidth.Text) End Sub Sub edtSampleText_Click () Const CF_BOTH = &H3& Const CF_EFFECTS = &H100& On Error GoTo edtSampleText_Error CMDialog1.Flags = CF_BOTH Or CF_EFFECTS CMDialog1.FontName = ITGraph1.FontName CMDialog1.FontSize = ITGraph1.FontSize CMDialog1.FontBold = ITGraph1.FontBold CMDialog1.FontItalic = ITGraph1.FontItalic CMDialog1.FontUnderline = ITGraph1.FontUnderline CMDialog1.FontStrikethru = ITGraph1.FontStrikethru CMDialog1.Color = ITGraph1.ForeColor CMDialog1.Action = 4 ITGraph1.FontName = CMDialog1.FontName ITGraph1.FontSize = CMDialog1.FontSize ITGraph1.FontBold = CMDialog1.FontBold ITGraph1.FontItalic = CMDialog1.FontItalic ITGraph1.FontUnderline = CMDialog1.FontUnderline ITGraph1.FontStrikethru = CMDialog1.FontStrikethru ITGraph1.ForeColor = CMDialog1.Color edtSampleText.FontName = CMDialog1.FontName edtSampleText.FontSize = CMDialog1.FontSize edtSampleText.FontBold = CMDialog1.FontBold edtSampleText.FontItalic = CMDialog1.FontItalic edtSampleText.FontUnderline = CMDialog1.FontUnderline edtSampleText.FontStrikethru = CMDialog1.FontStrikethru edtSampleText.ForeColor = CMDialog1.Color pctForeColor.BackColor = CMDialog1.Color edtSampleText_Error: Exit Sub End Sub Sub edtSampleText_GotFocus () ITGraph1.SetFocus End Sub Sub edtXSpace_Change () hscXSpace.Value = Val(edtXSpace.Text) ITGraph1.XSpace = Val(edtXSpace.Text) End Sub Sub edtXSpan_Change () hscXSpan.Value = Val(edtXSpan.Text) ITGraph1.XSpan = Val(edtXSpan.Text) End Sub Sub edtYSpace_Change () hscYSpace.Value = Val(edtYSpace.Text) ITGraph1.YSpace = Val(edtYSpace.Text) End Sub Sub edtYSpan_Change () hscYSpan.Value = Val(edtYSpan.Text) ITGraph1.YSpan = Val(edtYSpan.Text) End Sub Sub Form_Load () Dim deltaX As Single, deltaY As Single deltaX = (Screen.Width - Me.Width) / 2 - Me.Left deltaY = (Screen.Height - Me.Height) / 3 - Me.Top Me.Left = Me.Left + deltaX Me.Top = Me.Top + deltaY frmItemProperties.Left = frmItemProperties.Left + deltaX frmItemProperties.Top = frmItemProperties.Top + deltaY frmConnectionProperties.Left = frmConnectionProperties.Left + deltaX frmConnectionProperties.Top = frmConnectionProperties.Top + deltaY cmbDrawDir.Clear cmbDrawDir.AddItem "ITG_RightToLeft" cmbDrawDir.AddItem "ITG_LeftToRight" cmbDrawDir.AddItem "ITG_BottomToTop" cmbDrawDir.AddItem "ITG_TopToBottom" cmbDrawDir.ListIndex = ITG_TopToBottom cmbRubberBand.Clear cmbRubberBand.AddItem "ITG_RBNone" cmbRubberBand.AddItem "ITG_RBItems" cmbRubberBand.AddItem "ITG_RBHandles" cmbRubberBand.AddItem "ITG_RBBoth" cmbRubberBand.ListIndex = ITG_RBBoth ITGraph1.AddItem "Node #1" ITGraph1.AddItem "Node #2" ITGraph1.ConnectTo(0) = 1 ITGraph1.ConnectionLabel = "Connection" End Sub Sub hscDrawScale_Change () edtDrawScale.Text = hscDrawScale.Value If ITGraph1.DrawScale <> hscDrawScale.Value Then ITGraph1.DrawScale = hscDrawScale.Value End If End Sub Sub hscGap_Change () edtGap.Text = hscGap.Value ITGraph1.Gap = hscGap.Value End Sub Sub hscLineWidth_Change () edtLineWidth.Text = hscLineWidth.Value ITGraph1.LineWidth = hscLineWidth.Value End Sub Sub hscXSpace_Change () edtXSpace.Text = hscXSpace.Value ITGraph1.XSpace = hscXSpace.Value End Sub Sub hscXSpan_Change () edtXSpan.Text = hscXSpan.Value ITGraph1.XSpan = hscXSpan.Value End Sub Sub hscYSpace_Change () edtYSpace.Text = hscYSpace.Value ITGraph1.YSpace = hscYSpace.Value End Sub Sub hscYSpan_Change () edtYSpan.Text = hscYSpan.Value ITGraph1.YSpan = hscYSpan.Value End Sub Sub ITGraph1_Click (Button As Integer, Shift As Integer, X As Integer, Y As Integer) ITGraph1.SelectedIndex = -1 End Sub Sub ITGraph1_DblClick (Button As Integer, Shift As Integer, X As Integer, Y As Integer) ITGraph1.DrawScale = 0 hscDrawScale.Value = ITGraph1.DrawScale End Sub Sub ITGraph1_DragDrop (Source As Control, X As Single, Y As Single) X = X / Screen.TwipsPerPixelX Y = Y / Screen.TwipsPerPixelY If Source = pctZoomNode Then ITGraph1.QueryState = ITG_QueryGetSelectRectItems If ITGraph1.QueryState Then ITGraph1.SelectRectLeft = ITGraph1.ItemXpos(ITGraph1.QueryItem) - ITGraph1.XSpan / 2 ITGraph1.SelectRectTop = ITGraph1.ItemYpos(ITGraph1.QueryItem) - ITGraph1.YSpan / 2 ITGraph1.SelectRectWidth = 2 * ITGraph1.XSpan ITGraph1.SelectRectHeight = 2 * ITGraph1.YSpan ITGraph1.ZoomSelectRect = 1 Else ITGraph1.SelectRectLeft = X - 1.5 * ITGraph1.XSpan ITGraph1.SelectRectTop = Y - 1.5 * ITGraph1.YSpan ITGraph1.SelectRectWidth = 3 * ITGraph1.XSpan ITGraph1.SelectRectHeight = 3 * ITGraph1.YSpan ITGraph1.ZoomSelectRect = 1 End If End If End Sub Sub ITGraph1_DragOver (Source As Control, X As Single, Y As Single, State As Integer) X = X / Screen.TwipsPerPixelX Y = Y / Screen.TwipsPerPixelY If Source = pctZoomNode Then ITGraph1.SelectRectLeft = X ITGraph1.SelectRectTop = Y ITGraph1.SelectRectWidth = 0 ITGraph1.SelectRectHeight = 0 ITGraph1.QueryState = ITG_QueryGetSelectRectItems If ITGraph1.QueryState Then lblUnderCursor.Caption = ITGraph1.List(ITGraph1.QueryItem) Else lblUnderCursor.Caption = "<None>" End If End If End Sub Sub ITGraph1_ItemClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer) If ItemHandle = 0 Then ITGraph1.SelectedIndex = ItemIx ITGraph1.SetFocus If Shift And ITG_CtrlDown Then ITGraph1.ItemIndex(ItemIx) = 0 End If End If End Sub Sub ITGraph1_ItemConnect (FromIx As Integer, FromHandle As Integer, ToIx As Integer, ToHandle As Integer, Button As Integer, Shift As Integer) frmPlayground.Enabled = False frmConnectionProperties!edtConnectFromIndex = Format$(FromIx) If FromHandle <> 0 Then frmConnectionProperties!edtConnectFromHandle = Format$(FromHandle) Else frmConnectionProperties!edtConnectFromHandle = "3" End If frmConnectionProperties!edtConnectToIndex = Format$(ToIx) If ToHandle <> 0 Then frmConnectionProperties!edtConnectToHandle = Format$(ToHandle) Else frmConnectionProperties!edtConnectToHandle = "1" End If frmConnectionProperties!txtNewConnection.Caption = "NEW" frmConnectionProperties.Show End Sub Sub ITGraph1_ItemDblClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer) If ItemHandle = 0 Then frmPlayground.Enabled = False frmItemProperties!txtListIndex.Caption = ItemIx frmItemProperties.Show End If End Sub Sub ITGraph1_ItemMouseMove (ItemIx As Integer, ItemHandle As Integer, IsDragging As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer) If ItemIx = -1 Then lblUnderCursor = "<None>" Else If ItemHandle = 0 Then lblUnderCursor.Caption = ITGraph1.List(ItemIx) Else lblUnderCursor.Caption = ITGraph1.List(ItemIx) & "[" & Format$(ItemHandle) & "]" End If End If End Sub Sub ITGraph1_KeyPress (KeyAscii As Integer) Dim nodeStr$ If (ITGraph1.SelectedIndex >= 0) And (ITGraph1.SelectedIndex < ITGraph1.ListCount) Then nodeStr = ITGraph1.List(ITGraph1.SelectedIndex) If KeyAscii = 8 Then If Len(nodeStr) > 0 Then nodeStr = Left$(nodeStr, Len(nodeStr) - 1) End If Else nodeStr = nodeStr & Chr$(KeyAscii) End If ITGraph1.List(ITGraph1.SelectedIndex) = nodeStr End If End Sub Sub ITGraph1_LineDblClick (FromIx As Integer, ToIx As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer) If (FromIx <> -1) And (ToIx <> -1) Then frmPlayground.Enabled = False frmConnectionProperties!edtConnectFromIndex = Format$(FromIx) frmConnectionProperties!edtConnectToIndex = Format$(ToIx) frmConnectionProperties!txtNewConnection.Caption = "" frmConnectionProperties.Show ElseIf FromIx <> -1 Then MsgBox "This connection has multiple targets. Please select the target from the source's target list." frmPlayground.Enabled = False frmItemProperties!txtListIndex.Caption = FromIx frmItemProperties.Show DoEvents frmItemProperties!lstTargets.ListIndex = 0 frmItemProperties!lstTargets.SetFocus ElseIf ToIx <> -1 Then MsgBox "This connection has multiple sources. Please select the source from the target's source list." frmPlayground.Enabled = False frmItemProperties!txtListIndex.Caption = ToIx frmItemProperties.Show DoEvents frmItemProperties!lstSources.ListIndex = 0 frmItemProperties!lstSources.SetFocus Else MsgBox "The desired connection cannot be determined since there is more than one connection at this location." End If End Sub Sub ITGraph1_SelectRect (L As Integer, T As Integer, W As Integer, H As Integer, Button As Integer, Shift As Integer) If False Then ITGraph1.SelectRectLeft = L ITGraph1.SelectRectTop = T ITGraph1.SelectRectWidth = W ITGraph1.SelectRectHeight = H ITGraph1.PrintRectLeft = 0 ITGraph1.PrintRectTop = 0 ITGraph1.PrintRectWidth = Printer.Width / Printer.TwipsPerPixelX ITGraph1.PrintRectHeight = Printer.Height / Printer.TwipsPerPixelY Printer.Print ITGraph1.PrintToDC = Printer.hDC Printer.EndDoc Else ITGraph1.ZoomSelectRect = chkZoomOnSelectRect.Value If ITGraph1.DrawScale > hscDrawScale.Max Then ITGraph1.DrawScale = hscDrawScale.Max End If hscDrawScale.Value = ITGraph1.DrawScale End If End Sub Sub lstConnectionInfo_Click () ITGraph1.QueryData = lstConnectionInfo.ItemData(lstConnectionInfo.ListIndex) ITGraph1.QueryState = ITG_QueryMatchConnectionId lstSelectNode.Visible = False pctSpecialMenu.Visible = False pctMain.Enabled = True If ITGraph1.QueryState Then frmPlayground.Enabled = False frmConnectionProperties!edtConnectFromIndex = Format$(ITGraph1.ConnectFromIndex) frmConnectionProperties!edtConnectToIndex = Format$(ITGraph1.ConnectToIndex) frmConnectionProperties!txtNewConnection.Caption = "" frmConnectionProperties.Show End If End Sub Sub lstConnectionInfo_LostFocus () lstConnectionInfo.Visible = False End Sub Sub lstSelectNode_Click () If ITGraph1.DrawScale = 0 Then ITGraph1.DrawScale = 100 End If ITGraph1.SelectRectLeft = ITGraph1.ItemXpos(lstSelectNode.ItemData(lstSelectNode.ListIndex)) ITGraph1.SelectRectTop = ITGraph1.ItemYpos(lstSelectNode.ItemData(lstSelectNode.ListIndex)) ITGraph1.SelectRectWidth = ITGraph1.XSpan ITGraph1.SelectRectHeight = ITGraph1.YSpan ITGraph1.ZoomSelectRect = 0 lstSelectNode.Visible = False pctSpecialMenu.Visible = False pctMain.Enabled = True End Sub Sub lstSelectNode_LostFocus () lstSelectNode.Visible = False End Sub Sub optArrangeMode_Click (Index As Integer) ITGraph1.ArrangeMode = Index End Sub Sub optAutoArrange_Click () ITGraph1.AutoArrange = ITG_AutoArrange End Sub Sub optManualArrange_Click () ITGraph1.AutoArrange = ITG_ManualArrange End Sub Sub pctBackColor_Click () Const CC_RGBINIT = &H1& On Error GoTo pctBackColor_Error CMDialog1.Color = ITGraph1.BackColor CMDialog1.Flags = CC_RGBINIT CMDialog1.Action = 3 ITGraph1.BackColor = CMDialog1.Color pctBackColor.BackColor = CMDialog1.Color pctBackColor_Error: Exit Sub End Sub Sub pctFillColor_Click () Const CC_RGBINIT = &H1& On Error GoTo pctFillColor_Error CMDialog1.Color = ITGraph1.FillColor CMDialog1.Flags = CC_RGBINIT CMDialog1.Action = 3 ITGraph1.FillColor = CMDialog1.Color pctFillColor.BackColor = CMDialog1.Color edtSampleText.BackColor = CMDialog1.Color pctFillColor_Error: Exit Sub End Sub Sub pctForeColor_Click () Const CC_RGBINIT = &H1& On Error GoTo pctForeColor_Error CMDialog1.Color = ITGraph1.ForeColor CMDialog1.Flags = CC_RGBINIT CMDialog1.Action = 3 ITGraph1.ForeColor = CMDialog1.Color pctForeColor.BackColor = CMDialog1.Color edtSampleText.ForeColor = CMDialog1.Color pctForeColor_Error: Exit Sub End Sub Sub pctZoomNode_DragDrop (Source As Control, X As Single, Y As Single) If Source = pctZoomNode Then ITGraph1.DrawScale = 0 End If End Sub Sub pctZoomNode_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single) pctZoomNode.Drag 1 End Sub Sub pctZoomNode_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single) pctZoomNode.Drag 2 End Sub Sub txtTransferTarget_Click () txtTransferTarget.Visible = False pctSpecialMenu.Visible = False pctSpecialMenu.Enabled = True pctMain.Enabled = True End Sub Sub txtTransferTarget_LostFocus () txtTransferTarget.Visible = False End Sub